#include <bits/stdc++.h>
using namespace std;

const int R = 1e5 + 10;
vector<int> pr;
bool notPrime[R];
void CreatePrime(int maxVal)
{
	long long i, j;
	notPrime[0] = notPrime[1] = true;
	for (i = 2; i <= maxVal; ++i)
	{
		if (notPrime[i] == false)
		{
			pr.push_back(i);
			for (j = i; j * i <= maxVal && j * i < R; ++j) // 不开longlong见祖宗！！！
			{
				notPrime[i * j] = true;
			}
		}
	}
}
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);
	int L, maxId, sum = 0;
	cin >> L;
	CreatePrime(L);
	for (maxId = 0; maxId < pr.size(); ++maxId)
	{
		sum += pr[maxId];
		if (sum > L)
		{
			break;
		}
	}
	for (int i = 0; i < maxId; ++i)
	{
		cout << pr[i] << '\n';
	}
	cout << maxId;
	return 0;
}
